<template>
  <div class="goodsActivity-table__container">
    <el-table :data="goodsData" height="300" style="width:60%">
      <el-table-column
        prop="goodsNumber"
        label="商品编号"
        align="center"
      ></el-table-column>
      <el-table-column label="商品类型" align="center">
        <template slot-scope="scope">
          <span v-if="scope.row.type">{{
            scope.row.type | filterName('goods_type')
          }}</span>
          <span v-else>-</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="name"
        label="商品名称"
        align="center"
        min-width="150"
      ></el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button type="text" @click="handleDelete(scope.$index)">
            删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: ['goodsData'],
  data() {
    return {}
  },
  methods: {
    // 删除操作
    handleDelete(index) {
      this.$emit('deleteGoods', index)
    }
  }
}
</script>

<style lang="less" scoped>
.goodsActivity-table__container {
  margin: 0 0 18px 100px;
}
</style>
